#pragma once

#include "Property/EditorPropertyViewModel.h"
#include "EditorAddComponentPropertyModel.h"
#include "EditorAddComponentPropertyViewModel.m.h"

class RWidget;
class RSceneNodeComponent;

RCLASS()
class REditorAddComponentPropertyViewModel : public REditorPropertyViewModel
{
    ROBJECT

public:
    virtual void BindModel(TSharedObjectPtr<REditorPropertyModel> InModel
        ,TSharedObjectPtr<REditorObjectPropertyAbilityViewModel> InAbilityViewModel) override;

    void OnAddComponentClicked(TSharedObjectPtr<RWidget> InButtonWidget);

protected:
    TWeakObjectPtr<REditorAddComponentPropertyModel> AddComponentModel;

    void AddComponent(TSubclassOf<RSceneNodeComponent> InComponentClass);
};